home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / wattcp / include / bootp.h next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  2.5 KB  |  77 lines

  1. #define getsockname hack_getsockname
  2. #define sockaddr hack_sockaddr
  3. #define in_addr hack_in_addr
  4.  
  5. /*
  6.  * Bootstrap Protocol (BOOTP)
  7.  * Based on RFC 951.
  8.  */
  9.  
  10.  
  11. #define BOOTREQUEST     1    /* bootp.bp_op */
  12. #define BOOTREPLY    2
  13.  
  14. /*
  15.  * structure for send and receives
  16.  */
  17. typedef struct bootp {
  18.     byte     bp_op;        /* packet op code / message type. */
  19.     byte     bp_htype;    /* hardware address type, 1 = 10 mb ethernet */
  20.     byte     bp_hlen;    /* hardware address len, eg '6' for 10mb eth */
  21.     byte     bp_hops;    /* client sets to zero, optionally used by
  22.                    gateways in cross-gateway booting. */
  23.     longword bp_xid;    /* transaction ID, a random number */
  24.     word     bp_secs;    /* filled in by client, seconds elapsed since
  25.                    client started trying to boot. */
  26.     word     bp_spare;
  27.     longword bp_ciaddr;    /* client IP address filled in by client if known*/
  28.     longword bp_yiaddr;    /* 'your' (client) IP address
  29.                    filled by server if client doesn't know */
  30.     longword bp_siaddr;    /* server IP address returned in bootreply */
  31.     longword bp_giaddr;    /* gateway IP address,
  32.                    used in optional cross-gateway booting. */
  33.     byte     bp_chaddr[16];    /* client hardware address, filled by client */
  34.     byte     bp_sname[64];    /* optional server host name, null terminated*/
  35.  
  36.     byte     bp_file[128];    /* boot file name, null terminated string
  37.                    'generic' name or null in bootrequest,
  38.                    fully qualified directory-path
  39.                    name in bootreply. */
  40.     byte     bp_vend[ 64];    /* optional vendor-specific area */
  41. };
  42.  
  43.  
  44. extern struct bootp _bootp;
  45. extern word sock_inactive;
  46.  
  47. /*
  48.  * UDP port numbers, server and client.
  49.  */
  50. #define    IPPORT_BOOTPS        67
  51. #define    IPPORT_BOOTPC        68
  52.  
  53.  
  54. /******** the following is stolen from NCSA which came from CUTCP *********/
  55. /* I have not implemented these, but someone may wish to in the future so */
  56. /* I kept them around.                                                    */
  57. /**************************************************************************/
  58.  
  59. /*
  60.  * "vendor" data permitted for Stanford boot clients.
  61.  */
  62. struct vend {
  63.     byte      v_magic[4];    /* magic number */
  64.     longword v_flags;    /* flags/opcodes, etc. */
  65.     byte      v_unused[56];    /* currently unused */
  66. };
  67.  
  68. #define    VM_STANFORD    "STAN"    /* v_magic for Stanford */
  69. #define VM_RFC1048      "\143\202\123\143"
  70.  
  71. /* v_flags values */
  72. #define    VF_PCBOOT    1    /* an IBMPC or Mac wants environment info */
  73. #define    VF_HELP        2    /* help me, I'm not registered */
  74. #define TAG_BOOTFILE_SIZE       13     /* tag used by vend fields rfc 1048 */
  75.  
  76.  
  77.